package com.example.demo.rocketmq.controller;

import com.example.demo.rocketmq.provider.service.impl.OrderService;
import com.example.demo.rocketmq.vo.OrderChange;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/rocketMq")
public class TestRocketMqController {

    final
    OrderService orderService;

    public TestRocketMqController(OrderService orderService) {
        this.orderService = orderService;
    }

    @RequestMapping("/sendTransactionMessage")
    public void sendTransactionMessage(@RequestBody OrderChange orderChange) {
        orderService.sendTransactionMessage(orderChange);
    }

}
